<!--{template admin/tpl/header}-->

<div class="mainarea">
<div class="maininner">

<!--{if $allowmanage}-->
<div class="tabs_header">
	<ul class="tabs">
		<li$actives[all]><a href="admincp.php?ac=video"><span>浏览全部视频</span></a></li>
		<li class="null"><a href="admincp.php?ac=video&op=add">发布视频</a></li>
	</ul>
</div>
<!--{/if}-->
	
<!--{if $_GET['op']!='add' && $_GET['op']!='edit'}-->
	
	<form method="get" action="admincp.php">
	<div class="block style4">
		<table cellspacing="3" cellpadding="3">

		<!--{if $allowmanage}-->
		<tr><th>作者UID</th><td><input type="text" name="uid" value="$_GET[uid]"></td>
			<th>作者名</th><td><input type="text" name="username" value="$_GET[username]"></td>
		</tr>
		<!--{/if}-->

		<tr><th>发布时间</th><td colspan="3">
			<input type="text" name="dateline1" value="$_GET[dateline1]" size="10"> ~
			<input type="text" name="dateline2" value="$_GET[dateline2]" size="10"> (YYYY-MM-DD)
		</td></tr>
		
		<tr><th>热度范围</th><td colspan="3">
			<input type="text" name="hot1" value="$_GET[hot1]" size="10"> ~
			<input type="text" name="hot2" value="$_GET[hot2]" size="10">
		</td></tr>

		<tr><th>结果排序</th>
		<td colspan="3">
		<select name="orderby">
		<option value="">默认排序</option>
		<option value="dateline"$orderby[dateline]>发布时间</option>
		<option value="hot"$orderby[hot]>热度</option>
		</select>
		<select name="ordersc">
		<option value="desc"$ordersc[desc]>递减</option>
		<option value="asc"$ordersc[asc]>递增</option>
		</select>
		<select name="perpage">
		<option value="20"$perpages[20]>每页显示20个</option>
		<option value="50"$perpages[50]>每页显示50个</option>
		<option value="100"$perpages[100]>每页显示100个</option>
		<option value="1000"$perpages[1000]>一次处理1000个</option>
		</select>
		<input type="hidden" name="ac" value="video">
		<input type="submit" name="searchsubmit" value="搜索" class="submit">
		</td>
		</tr>
		</table>
	</div>
	</form>
<!--{/if}-->


<!--{if $_GET['op']=='add' || $_GET['op']=='edit'}-->
	<form method="post" action="admincp.php?ac=video">

	<script language="javascript" src="image/editor/editor_function.js"></script>
    
	<script language="javascript" src="source/script_upload_jq.js"></script>
    <script type="text/javascript">
	function selhx(ty){
		
		if(ty==1){
			
			jQuery('#selhxtr').show();
		}else{
			jQuery('#vid').val('');
			jQuery('#selhxtr').hide();
		}
		
	}
	
	</script>
	<div class="bdrcontent">
		<table cellspacing="3" cellpadding="3" width="100%">
		<tr>
			<th>是否为花絮</th>
			<td> 
			<input type="radio" name="ty" id="ty1" value="1" onclick="selhx(1)" {if $video['ty']==1}checked='checked'{/if} /> <label for='ty1'>是</label>
			<input type="radio" name="ty" id="ty0" value="0" onclick="selhx(0)" {if $video['ty']==0}checked='checked'{/if} /> <label for='ty0'>否</label>
			</td>
		</tr>
		
		<tr id='selhxtr' <!--{if $video['ty']==0}style='display:none;'{/if}-->>
			<th>选择父视频</th>
			<td>
			<select name="vid" id="vid">
			<option value="">请选择上级视频</option>
			<!--{loop $videolist $vl}-->
			<option value="{$vl['videoid']}" <!--{if $vl['videoid']==$video['vid']}selected='selected'{/if}-->>{$vl['videoid']}){$vl['title']}</option>
			<!--{/loop}-->
			</select>
			</td>
		</tr>
		

		<tr><th width="150">视频标题</th><td><input type="text" name="title" value="$video[title]" size="100"> <br>支持html，例如：加粗 &lt;b>&lt;/b>，变色 &lt;font color=red>&lt;/font></td></tr>
		<tr><th>视频介绍</th><td>
			<textarea class="userData" name="body" id="uchome-ttHtmlEditor" style="height:100%;width:100%;display:none;border:0px">$video[body]</textarea>
			<iframe src="editor.php?charset=$_SC[charset]&allowhtml=1" name="uchome-ifrHtmlEditor" id="uchome-ifrHtmlEditor" scrolling="no" border="0" frameborder="0" style="width:100%;border: 1px solid #C5C5C5;" height="400"></iframe>
		</td></tr>

		<tbody id="image">
		<tr><th>视频缩略图地址</th><td><input type="text" id='thumburl' name="thumburl" value="$video[thumburl]" size="60"> <input type="button" name="clickbutton[]" value="上传图片" class="button" onclick="uploadsimg('thumburl')" /> </td></tr>
		<tr><th>视频地址</th><td><input type="text" id='videourl' name="videourl" value="$video[videourl]" size="60"> <input type="button" name="clickbutton[]" value="上传视频" class="button" onclick="uploadsimg('videourl')" /> 仅支持flv格式视频。</td></tr>
		</tbody>
		
		<tr><th>发布时间</th><td><input type="text" name="dateline" value="$video[dateline]" size="30"> (当前时刻：<!--{eval echo sgmdate('Y-m-d H:i');}-->)
			<br>您可以填写一个将来的日期和时间，那么这条视频会在这个将来的日期到来之前，一直显示在第一位。</td></tr>
			
		<!--{if $video['id']}-->
		<tr><th>视频热度</th><td><input type="text" name="hot" value="$video[hot]" size="10"></td></tr>
		<!--{/if}-->

		<tr><td>&nbsp;</td><td>
		<input type="hidden" name="videoid" value="$video[videoid]" />
		<input type="hidden" name="videouid" value="$video[uid]" />
		<input type="hidden" name="id" value="$video[id]" />
		<input type="hidden" name="idtype" value="$video[idtype]" />
		<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
		<input type="submit" name="videosubmit" value="提交保存" class="submit"<!--{if empty($video[uid])}--> onclick="edit_save();"<!--{/if}-->>
		<!--{if $video[videoid]}-->
		&nbsp; <a href="admincp.php?ac=video&op=delete&videoid=$video[videoid]" onclick="return confirm('确定要删除吗？');">删除此视频</a>
		<!--{/if}-->
		</td>
		</tr>
		</table>
	</div>
	</form>
	<br>
<!--{else}-->

	<!--{if $list}-->
<script type="text/javascript" src="/js/swfobject.js"></script>
	<form method="post" action="admincp.php?ac=video">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	<div class="bdrcontent">
		<div class="video">
		<div id="video_div" class="video_content">
			<ul>
			<!--{loop $list $value}-->
			
			<li id="video_$value[videoid]_li">
				<div style="width:100%;overflow:hidden;">
					<div style="padding:10px 0 0 0;" class="gray">
						<input type="<!--{if $allowbatch}-->checkbox<!--{else}-->radio<!--{/if}-->" name="ids[]" value="$value[videoid]"> 选择
                        
                        &nbsp;&nbsp;&nbsp;
                        
                        <strong><a href="video.php?id=$value['videoid']" target='_blank'>$value[title]</a></strong> 
						<span class="time">(<!--{date('m-d H:i',$value[dateline],1)}-->)</span>
						&nbsp;
                        <!--{if $value[hot]}--><span style="color:red;">(热度：$value[hot])</span><!--{/if}-->
                        &nbsp;
						<!--{if $allowmanage}--> &nbsp;
						<a href="admincp.php?ac=video&op=edit&videoid=$value[videoid]">编辑</a>
						<!--{/if}-->
					</div>
					
					
					<div class="videoContent">
						<table><tr><td width='300'>
						<!--{if $value['videourl']}-->

                        <div id="videoshow_video$value[videoid]">
						<script type="text/javascript"> 
							var s1 = new SWFObject("/js/flvplayer.swf","single","300","225","10");
							s1.addParam("allowfullscreen","true");
							s1.addVariable("file","$value[videourl]");
							s1.addVariable("image","$value[thumburl]");
							s1.addVariable("width","300");
							s1.addVariable("height","225");
							s1.write("videoshow_video$value[videoid]");
						</script>
                        </div>
						<!--{/if}-->
						</td><td>
						<table>
							<tr>
								<td colspan='2'>花絮列表</td>
							</tr>
						<!--{loop $value['vrow'] $vl}-->
							
							<!--{if $vl['videourl']}-->
<tr>
								<td>
							<div id="videoshow_video{$value[videoid]}_{$vl[videoid]}">
							<script type="text/javascript"> 
								var s1 = new SWFObject("/js/flvplayer.swf","single","200","150","10");
								s1.addParam("allowfullscreen","true");
								s1.addVariable("file","$vl[videourl]");
								s1.addVariable("image","$vl[thumburl]");
								s1.addVariable("width","200");
								s1.addVariable("height","150");
								s1.write("videoshow_video{$value[videoid]}_{$vl[videoid]}");
							</script>
							</div></td><td><input type="<!--{if $allowbatch}-->checkbox<!--{else}-->radio<!--{/if}-->" name="ids[]" value="$vl['videoid']"> <a href="video.php?id=$vl['videoid']" target='_blank'>$vl['title']</a> <span class="time">(<!--{date('m-d H:i',$vl[dateline],1)}-->)</span> <!--{if $allowmanage}--> &nbsp;
						<a href="admincp.php?ac=video&op=edit&videoid=$vl[videoid]">编辑</a>
						<!--{/if}--></td>
							</tr>
						<!--{/if}-->
						
						<!--{/loop}-->
						
						</table>
						</td></tr>
					</table>
					</div>
				</div>
			</li>
			<!--{/loop}-->
			</ul>
		</div>
		</div>
	</div>
	<div class="footactions">
		<!--{if $allowbatch}-->
		<input type="checkbox" id="chkall" name="chkall" onclick="checkAll(this.form, 'ids')">全选
		<!--{/if}--> 
		<input type="hidden" name="mpurl" value="$mpurl">
		<input type="submit" name="deletesubmit" value="批量删除" onclick="return confirm('本操作不可恢复，确认删除？');" class="submit">

		<div class="pages">$multi</div>
	</div>

	</form>
	<!--{else}-->
	<div class="bdrcontent">
		<p>指定条件下还没有数据</p>
	</div>
	<!--{/if}-->

<!--{/if}-->

</div>
</div>


<div class="side">
	<!--{template admin/tpl/side}-->
</div>

<!--{template admin/tpl/footer}-->